x86/vlapic: Don't reset APIC ID when handling INIT signal
authorChao Gao <chao.gao@intel.com>
Fri, 21 Apr 2017 10:09:48 +0000 (12:09 +0200)
committerJan Beulich <jbeulich@suse.com>
Fri, 21 Apr 2017 10:09:48 +0000 (12:09 +0200)
commita2a897ccd2749abdc4d68ae2b34443712724a75c
tree5df19b02e15242787756b9d42afc877a13fc779f
parentde22e0dd0df7244052b978fdd939aae7a0937077
x86/vlapic: Don't reset APIC ID when handling INIT signal

According to SDM "ADVANCED PROGRAMMABLE INTERRUPT CONTROLLER (APIC) ->
"EXTENDED XAPIC (X2APIC)" -> "x2APIC State Transitions", the APIC mode
and APIC ID are preserved when handling INIT signal and a reset places
APIC to xAPIC mode and APIC base address to 0xFEE00000h (this part
is in "Local APIC" -> "Local APIC Status and Location"). So there are
two problems in current code:
1. Using reset logic (aka vlapic_reset) to handle INIT signal.
2. Forgetting resetting APIC mode and base address in vlapic_reset()

This patch introduces a new function vlapic_do_init() and replaces the
wrongly used vlapic_reset(). Also reset APIC mode and APIC base address
in vlapic_reset().

Note that: LDR is read only in x2APIC mode. Resetting it to zero in x2APIC
mode is unreasonable. This patch also doesn't reset LDR when handling INIT
signal in x2APIC mode.

Signed-off-by: Chao Gao <chao.gao@intel.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
Release-acked-by: Julien Grall <julien.grall@arm.com>
xen/arch/x86/hvm/vlapic.c